﻿using System.Web.Mvc;
using TSharp.Core.Mvc.Extensions;
using TSharp.Core.Mvc.Web;

namespace TSharp.Core.AppBox.Areas.Admin.Controllers
{
    public class RoleController : TSharpController
    {
        //
        // GET: /Admin/Role/

        public ActionResult Index()
        {
            ViewData["test"] = "roleTest";
            return View();
        }

        //
        // GET: /Admin/Role/Details/5

        public ActionResult Details(int id)
        {
            return View();
        }

        //
        // GET: /Admin/Role/Create

        public ActionResult Create()
        {
            return View();
        }

        //
        // POST: /Admin/Role/Create

        [HttpPost]
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /Admin/Role/Edit/5

        public ActionResult Edit(int id)
        {
            return View();
        }

        //
        // POST: /Admin/Role/Edit/5

        [HttpPost]
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add update logic here

                return this.RedirectToAction(m => m.Index());
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /Admin/Role/Delete/5

        public ActionResult Delete(int id)
        {
            return View();
        }

        //
        // POST: /Admin/Role/Delete/5

        [HttpPost]
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
    }
}
